﻿<phone:PhoneApplicationPage 
    x:Class="Cnblogs.CommentsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:delay="clr-namespace:Cnblogs"
    xmlns:HTML="clr-namespace:Alexis.WindowsPhone.Html;assembly=Alexis.WindowsPhone.Html"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="DT_Comment">
            <Grid x:Name="grd" Margin="0,0,0,20">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Image x:Name="imgAvatar" VerticalAlignment="Top" delay:LowProfileImageLoader.UriSource="{Binding Avatar}" 
                       Source="/Images/DefaultProfile.png"
                       Grid.Column="0"
                       Tap="imgAvatar_Tap"
                       Margin="0,0,12,0"
                       Height="48" Width="48" />
                <TextBlock Grid.Column="1" Text="{Binding AuthorInfo.Name}" FontSize="24" Width="384" FontWeight="Bold" />
                <!--<HTML:HtmlTextBlock Grid.Row="1" Grid.Column="1" Html="{Binding Content}" HyperlinkFontFamily="Segoe WP" HyperlinkFontSize="18" HorizontalAlignment="Left" Width="384" />-->
                <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Content}" HorizontalAlignment="Left" TextWrapping="Wrap" Width="360"/>
            </Grid>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <TextBlock x:Name="tbk_title"  Margin="24,0,24,0" FontSize="28" Width="432" TextWrapping="Wrap" FontWeight="Bold" />
        
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,30,12,0">
            <ScrollViewer>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
                    <ItemsControl x:Name="lbx_comment" 
                     Margin="12,0,12,0"
                     ItemTemplate="{StaticResource DT_Comment}" />
                    <Button Grid.Row="1" x:Name="btn_loadmore" Content="加载更多..." Visibility="Collapsed" Click="btn_loadmore_click" BorderThickness="0" Height="70"/>
                </Grid>
            </ScrollViewer>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>
